company logo

Value :: operator[] - Locate array instance

When accessing array attributes, one may access the complete array or a single value within an array. In order to access array elements, the [] operator has to be used. The operator returns single element, which behaves not as array anymore.

In order to access array elements, an instance has to be selected in the parent property of the array (when existing). Otherwise, an exception is thrown. When trying to access an array element with an index number equal to or higher than the array size, the function throws an exception (no instance available).

//  names[2] - refers to the third element in the names array

//  names    - refers to the complete array

Return value:  Value handle ( odaba::Value & )

A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.

Implementation details

odaba::Value & Value  :: operator[] ( int32 iPosition )
  • iPosition - Position in collection

    The position of an element in a collection is beginning with 0 for the first element.